/*
 * Context.java
 *
 * Stateroom - Java framework library for finite state machines
 * Copyright (C) 2009 by Matthew Werny
 * All Rights Reserved
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
package net.iceflow.stateroom.interfaces;

import net.iceflow.stateroom.enums.Status;

/**
 * Container for contextual information specific to an individual machine run instance.
 * @param <M> Type used to represent the machine model
 */
public interface Context<M extends Model> {

    /**
     * Gets the current state in this machine context after the most recent evaluation cycle.
     * @return Current state in this run context
     */
    State<M> getCurrentState();

    /**
     * Sets the current state in this machine context after the most recent evaluation cycle.
     * @param currentState State to be set as the current state in this run context
     */
    void setCurrentState(final State<M> currentState);

    /**
     * Gets the current status of the machine after the most recent evaluation cycle.
     * @return Status of the machine in this run context
     */
    Status getStatus();

    /**
     * Sets the current status of the machine after the most recent evaluation cycle.
     * @param status Status of the machine in this run context
     */
    void setStatus(final Status status);

    /**
     * Gets the model used by the context.
     * @return the model
     */
    M getModel();

    /**
     * Sets the model used by the context.
     * @param model the model to set
     */
    void setModel(final M model);
}
